package com.ruoyi.project.system.banpostarea.service.impl;

import com.ruoyi.common.utils.text.Convert;
import com.ruoyi.common.utils.uniquekey.IdGererateFactory;
import com.ruoyi.project.system.banpostarea.domain.BanPostarea;
import com.ruoyi.project.system.banpostarea.mapper.BanPostareaMapper;
import com.ruoyi.project.system.banpostarea.service.IBanPostareaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 禁止下单地区Service业务层处理
 * 
 * @author LCL
 * @date 2020-12-31
 */
@Service
public class BanPostareaServiceImpl implements IBanPostareaService 
{
    @Autowired
    private BanPostareaMapper banPostareaMapper;
    @Resource
    private IdGererateFactory idGererateFactory;

    /**
     * 查询禁止下单地区
     * 
     * @param id 禁止下单地区ID
     * @return 禁止下单地区
     */
    @Override
    public BanPostarea selectBanPostareaById(String id)
    {
        return banPostareaMapper.selectBanPostareaById(id);
    }

    /**
     * 查询禁止下单地区列表
     * 
     * @param banPostarea 禁止下单地区
     * @return 禁止下单地区
     */
    @Override
    public List<BanPostarea> selectBanPostareaList(BanPostarea banPostarea)
    {
        return banPostareaMapper.selectBanPostareaList(banPostarea);
    }

    /**
     * 新增禁止下单地区
     * 
     * @param banPostarea 禁止下单地区
     * @return 结果
     */
    @Override
    public int insertBanPostarea(BanPostarea banPostarea)
    {
        banPostarea.setId(this.idGererateFactory.nextStringId());
        return banPostareaMapper.insertBanPostarea(banPostarea);
    }

    /**
     * 修改禁止下单地区
     * 
     * @param banPostarea 禁止下单地区
     * @return 结果
     */
    @Override
    public int updateBanPostarea(BanPostarea banPostarea)
    {
        return banPostareaMapper.updateBanPostarea(banPostarea);
    }

    /**
     * 删除禁止下单地区对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteBanPostareaByIds(String ids)
    {
        return banPostareaMapper.deleteBanPostareaByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除禁止下单地区信息
     * 
     * @param id 禁止下单地区ID
     * @return 结果
     */
    @Override
    public int deleteBanPostareaById(String id)
    {
        return banPostareaMapper.deleteBanPostareaById(id);
    }

    @Override
    public List<BanPostarea> findAll() {
        return banPostareaMapper.findAll();
    }
}
